package me.spring.cloud.common.components.oauth2.basic;

/**
 * @author: luffy
 * @create: 2018-09-10 14:55
 **/
public class OauthConstants {

    private final static String USER_ROLE_KEY = "role";

    public static String getUserRoleKey(String userId) {
        return userId + ":" + USER_ROLE_KEY;
    }

    private final static String SYS_SERVER_KEY = "sys:server:";

    public static String getSysServerKey(String serverId) {
        return SYS_SERVER_KEY + serverId;
    }

    public static String getUserServerKey(String userId, String serverId) {
        return getSysServerKey(serverId) + ":" + userId;
    }

    private final static String USER_RESOURCE_KEY = "resource";

    public static String getUserResourceKey(String userId) {
        return userId + ":" + USER_RESOURCE_KEY;
    }

}
